﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

#if UNITY_EDITOR

using Sirenix.OdinInspector.Editor;
using Sirenix.Utilities.Editor;

#endif

// Attribute used by the NotOneAttributeDrawer
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
public class OdinInspectorButtonAttribute : Attribute
{
    public GroupBaseData entry;
}

#if UNITY_EDITOR

// Place the drawer script file in an Editor folder.
// Remember to add the OdinDrawer to your custom drawer classes, or it will not be found by Odin.
[OdinDrawer]
public class OdinInspectorButtonDrawer : OdinAttributeDrawer<OdinInspectorButtonAttribute, GroupBaseData>
{
    protected override void DrawPropertyLayout(IPropertyValueEntry<GroupBaseData> entry, OdinInspectorButtonAttribute attribute, GUIContent label)
    {
        SirenixEditorGUI.BeginBox();
        GUILayout.Space(15);
        if (GUILayout.Button("SaveGroupBaseData"))
        {
            entry.SmartValue.SaveData();
        }
        GUILayout.Space(15);
        SirenixEditorGUI.EndBox();
        // Continue the drawer chain.
        //this.CallNextDrawer(entry, label);
    }
}
#endif

